﻿@model FashionWebsite.Models.DAL.DalProduct
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    var product = Model.product;
    var countRow = 0;
}
<form name="formProduct" method="post">
<div id="toolbar-box">
    <div class="t"><div class="t"><div class="t"></div></div></div>
    <div class="m">
        <div class="toolbar-list" id="toolbar">
            <ul>
                <li class="button" id="toolbar-new">
                    <a href="ProductManager/Add" class="toolbar"><span class="icon-32-new" title="Thêm"></span>Thêm </a></li>
                <li class="button" id="toolbar-edit">
                    <a href="http://vsw-demo.allproject.net/CP/ModNews/Index.aspx#" onclick="javascript:if(document.vswForm.boxchecked.value&gt;0){vsw_exec_cmd(&#39;edit&#39;)}" class="toolbar">
                        <span class="icon-32-edit" title="Sửa"></span>Sửa </a></li>
                <li class="divider"></li>
                <li class="button" id="toolbar-publish">
                    <a href="http://vsw-demo.allproject.net/CP/ModNews/Index.aspx#" onclick="javascript:if(document.vswForm.boxchecked.value&gt;0){vsw_exec_cmd(&#39;publish&#39;)}" class="toolbar">
                        <span class="icon-32-publish" title="Duyệt"></span>Duyệt </a></li>
                <li class="button" id="toolbar-unpublish">
                    <a href="http://vsw-demo.allproject.net/CP/ModNews/Index.aspx#" onclick="javascript:if(document.vswForm.boxchecked.value&gt;0){vsw_exec_cmd(&#39;unpublish&#39;)}" class="toolbar">
                        <span class="icon-32-unpublish" title="Bỏ duyệt"></span>Bỏ duyệt </a></li><li class="divider"></li>
                <li class="button" id="toolbar-delete">
                    <a href="http://vsw-demo.allproject.net/CP/ModNews/Index.aspx#" onclick="javascript:if(document.vswForm.boxchecked.value&gt;0){if(confirm(&#39;Bạn chắc là mình muốn xóa chứ !&#39;)){vsw_exec_cmd(&#39;delete&#39;)}}" class="toolbar">
                        <span class="icon-32-delete" title="Xóa"></span>Xóa </a></li>
                <li class="button" id="toolbar-copy"><a href="http://vsw-demo.allproject.net/CP/ModNews/Index.aspx#" onclick="javascript:if(document.vswForm.boxchecked.value&gt;0){vsw_exec_cmd(&#39;copy&#39;)}" class="toolbar">
                    <span class="icon-32-copy" title="Sao chép"></span>Sao chép </a></li>
                <li class="divider"></li><li class="button" id="toolbar-config">
                    <a href="http://vsw-demo.allproject.net/CP/ModNews/Index.aspx#" onclick="vsw_exec_cmd(&#39;config&#39;)" class="toolbar">
                        <span class="icon-32-config" title="Xóa cache"></span>Xóa cache </a></li>

            </ul>
        </div>
        <div class="pagetitle icon-48-article">
           <h2>Sản phẩm</h2>
        </div>
        <div class="clr"></div>
    </div>
    <div class="b"><div class="b"> <div class="b"></div></div></div>
</div> <!-- End toolbar-box -->
<div class="clr"></div>

<div id="element-box">
    <div class="t"><div class="t"><div class="t"></div></div></div>
    <div class="m">
             <!-- start tim kiem -->
         <table>
            <tbody><tr>
                <td width="100%">
                     Lọc: <input type="text" value="" id="filter_search" class="text_area" onchange="VSWRedirect();return false;">
                    <button onclick="VSWRedirect();return false;">Tìm kiếm</button>
                </td>
                <td nowrap="nowrap">
                   Chuyên mục : 
                    <select id="filter_menu" onchange="VSWRedirect()" class="inputbox" size="1">
                         <option value="0">(Tất cả)</option>
                         <option value="353">&nbsp;  Danh mục Bài viết</option><option value="855">&nbsp; ---- Giới thiệu</option><option value="871">&nbsp; ---- Tin tức</option><option value="1104">&nbsp; ---- Tư vấn</option><option value="1123">&nbsp; -------- test1</option><option value="1124">&nbsp; -------- test2</option><option value="1125">&nbsp; -------- test3</option><option value="1120">&nbsp; ---- Thanh toán</option><option value="1121">&nbsp; ---- Cước vận chuyển</option><option value="1122">&nbsp; ---- Khuyến mại</option>
                    </select>
                   Vị trí :
                   <select id="filter_state" onchange="VSWRedirect()" class="inputbox" size="1">
                         <option value="0">(Tất cả)</option>
                         <option value="1">Tiêu điểm</option>
                    </select>
                   Ngôn ngữ :<select name="filter_lang" id="filter_lang" onchange="VSWRedirect(&#39;Index&#39;,&#39;0&#39;,&#39;parent_id&#39;)" class="inputbox" size="1"><option selected="" value="1">Việt Nam</option><option value="2">English</option></select>
                </td>
            </tr>
        </tbody></table>
        <!-- End tim kiem -->
         <!-- start ds san pham -->
        <table class="adminlist" cellspacing="1">
            <thead>
                <tr>
                    <th width="1%">
                        #
                    </th>
                    <th width="1%">
                        <input type="checkbox" name="toggle" value="" onclick="checkAll(20);">
                    </th>
                    <th class="title">
                        <a href="javascript:VSWRedirect('Index', 'Name-desc', 'Sort');">Tên Sản Phẩm</a>
                    </th>
                    <th style="width:40px" nowrap="nowrap">
                        <a href="javascript:VSWRedirect('Index', 'File-desc', 'Sort');">Ảnh </a>
                    </th>
                    <th nowrap="nowrap">
                        <a href="javascript:VSWRedirect('Index', 'MenuID-desc', 'Sort');">Chuyên mục </a>
                    </th>
                    <th width="1%" nowrap="nowrap">
                        <a href="javascript:VSWRedirect('Index', 'Published-desc', 'Sort');">Size </a>
                    </th>
                    <th width="1%" nowrap="nowrap">
                        <a href="javascript:VSWRedirect('Index', 'Published-desc', 'Sort');">Giá </a>
                    </th>
                    <th width="1%" nowrap="nowrap">
                        <a href="javascript:VSWRedirect('Index', 'Published-desc', 'Sort');">Nhà Sản Xuất </a>
                    </th>
                   
                    <th width="1%" nowrap="nowrap">
                         <a href="javascript:VSWRedirect('Index', 'Order-desc', 'Sort');">Sắp xếp </a>
                        <a href="javascript:vsw_exec_cmd('saveorder')" class="saveorder" title="Lưu sắp xếp"></a>
                    </th>
                    <th width="1%" nowrap="nowrap">
                        <a href="javascript:VSWRedirect('Index', 'ID-desc', 'Sort');">Tình Trạng </a>
                    </th>
                     <th width="1%" nowrap="nowrap">
                        <a href="javascript:VSWRedirect('Index', 'Activity-desc', 'Sort');">Sửa </a>
                    </th>
                </tr>
            </thead>
 @{
    string standardizedActionName = FashionStoreMVC.FFormHelper.StandardActionName(FashionWebsite.Models.Utils.FConst.ListProducts);
    string standardizedControllerName = FashionStoreMVC.FFormHelper.StandardActionName(FashionWebsite.Models.Utils.FControllerName.ManagerController);
    string urlTemplate = Html.ActionLink("{0}",
                                standardizedActionName, standardizedControllerName,
                                new { id = Request.RequestContext.RouteData.Values["id"], page = "{0}" }, null).ToHtmlString();

    FashionStoreMVC.Models.PagingModel pagingModel = new FashionStoreMVC.Models.PagingModel();
    pagingModel.Total = ViewBag.Count == null ? 0 : ViewBag.Count;
    pagingModel.NumbersPerPage = ViewBag.numberRecordOfPage == null ? 5 : ViewBag.numberRecordOfPage;
    pagingModel.PagingTemplate = urlTemplate;
}

            <tfoot>
                <tr>
                    <td colspan="15">
                       @Html.Partial("Paging", pagingModel)
                    </td>
                </tr>
            </tfoot>
            <tbody>
        @foreach (var item in product)
        {
                <tr class="row0">
                    <td align="center">
                       @Html.DisplayFor(modelItem => item.ProductId)
                    </td>
      
                    <td align="center">
                        <input type="checkbox" id="cb0" name="cid" value="5716" onclick="isChecked(this.checked);">
                    </td>
                    <td>
                        <a href="javascript:VSWRedirect('Add', 5716)">@Html.DisplayFor(modelItem => item.ProductName)i</a>
                        
                        <p class="smallsub">(<span>Mã</span>: Khuyen-mai)</p>
                         
                    </td>

                    <td align="center">
                       @Html.DisplayFor(modelItem => item.UrlImage)
                    </td>
                    <td align="center">
                       @Html.DisplayFor(modelItem => item.CategoryId)
                    </td>
                     <td align="center">
                       @Html.DisplayFor(modelItem => item.Color)
                    </td>
                    <td align="center">
                       @Html.DisplayFor(modelItem => item.Price)
                    </td>
                    <td align="center">
                        @Html.DisplayFor(modelItem => item.ProducerId)
                    </td>
                    <td align="center">
                        @Html.DisplayFor(modelItem => item.ProducerId)
                    </td>
                    <td align="center">
                       <a class="jgrid hasTip" href="javascript:void(0);" onclick="vsw_exec_cmd(&#39;[publishgx][5716,False]&#39;);return false;" title=""><span class="state publish"></span></a>
                        
                    </td>
                    <td class="order">
                        <input type="text" id="order[5716]" size="10" value="56" class="text-area-order" style="text-align: center">
                    </td>
                    <td align="center">
                       
                        @Html.ActionLink("Edit", "Edit", new { id=item.ProductId})
                    </td>
                   
                </tr>
        }          
                
                
            </tbody>
        </table>
       

 <!-- end ds san pham -->
        <div class="clr"></div>
    </div>
    <div class="b"><div class="b"><div class="b"></div></div></div>
</div>
</form>

<script>
    $('#dynamic-select').bind('change', function () { // bind change event to select
        var url = $(this).val(); // get selected value
        if (url != '') { // require a URL
            window.location = url; // redirect
        }
        return false;
    });
</script>
